<!-- Modal -->
<div class="modal-dialog wide" style="width: 900px;">
    <div class="modal-content">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
            <h4 class="modal-title" id="myModalLabel">
            <#if xcJjbhz??>
                <#if xcJjbhz.id??>
                    编辑
                <#else>
                    编辑
                </#if>
            </#if>
            </h4>
        </div>
        <div class="modal-body">
            <div id="errorMessage"><#include "../../message.ftl" /></div>
            <form class="form-horizontal" role="form" id="xcJjbhzForm" method="post"
                  action="${absoluteContextPath}/xc/xcJjbhz/saves">
            <#if xcJjbhz??>
                <#if xcJjbhz.id??>
                    <input type="hidden" name="id" value="${xcJjbhz.id?c}"/>
                <#else>
                    <input type="hidden" name="id" value=""/>
                </#if>
            </#if>
                <div class="modal-body">
                    <div id="errorMessage"><#include "../../message.ftl" /></div>
                    <form class="form-horizontal" role="form" id="xcJjbhzmxForm" method="post"
                          action="${absoluteContextPath}/xc/xcJjbhzmx/saves">
                    <#if xcJjbhzmx??>
                        <#if xcJjbhzmx.id??>
                            <input type="hidden" name="id" value="${xcJjbhzmx.id?c}"/>
                        <#else>
                            <input type="hidden" name="id" value=""/>
                        </#if>
                    </#if>
                        <div class="row">
                            <div class="tile-body nopadding">
                                <div class="table-responsive" id="tableContent">
                                    <table class="table table-datatable table-gray" id="tab">
                                        <thead>
                                        <tr>
                                            <th style="display:none;">ID</th>
                                            <th>用户姓名</th>
                                            <th>健康宣教讲解</th>
                                            <th>体检报告讲解</th>
                                            <th>常规引荐</th>
                                            <th>跟进引荐</th>

                                            <th>BMI大于24</th>
                                            <th>BMI大于28</th>
                                            <th>讲解开单量</th>
                                            <th style="width: 10%">操作</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <#if jjbhzmxList??>
                                            <#list jjbhzmxList as xcJjbhzmx>
                                            <tr id="${xcJjbhzmx.id?c!''}" align="center">

                                                <td style="display:none;"><input name="ids" value="${xcJjbhzmx.id?c!''}"
                                                                                 type="text" class="form-control"/></td>
                                                <td><input name="userName" value="${xcJjbhzmx.userName!''}" type="text"
                                                           class="form-control"/></td>
                                                <td><input name="jkxjJj" value="${xcJjbhzmx.jkxjJj!''}" type="text"
                                                           class="form-control"/></td>
                                                <td><input name="tjJj" value="${xcJjbhzmx.tjJj!''}" type="text"
                                                           class="form-control"/></td>
                                                <td><input name="jkxjYj" value="${xcJjbhzmx.jkxjYj!''}" type="text"
                                                           class="form-control"/></td>

                                                <td><input name="CLp" value="${xcJjbhzmx.CLp!''}" type="text"
                                                           class="form-control"/></td>

                                                <td><input name="ALp" value="${xcJjbhzmx.ALp!''}" type="text"
                                                           class="form-control"/></td>
                                                <td><input name="BLp" value="${xcJjbhzmx.BLp!''}" type="text"
                                                           class="form-control"/></td>
                                                <td><input name="tjGj" value="${xcJjbhzmx.tjGj!''}" type="text"
                                                           class="form-control"/></td>
                                                <td><a class="btn btn-orange btn-radio  nopadding"
                                                       onclick="deleteEditjjbmx(${xcJjbhzmx.id?c!''});" title="删除"> <i
                                                        class="fa fa-trash-o"></i> </a></td>
                                            </tr>

                                            </#list>
                                        </#if>

                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
            </form>
        </div>
        <div class="modal-footer">
            <button type="button" class="btn btn-default" data-dismiss="modal" aria-hidden="true">关闭</button>
            <button type="button" class="btn btn-primary" onclick="save();">保存</button>
        </div>
    </div>
</div>
<script>
    function save() {
        $("#" + "xcJjbhzForm").ajaxSubmit({
            success: function (data) {
                data = JSON.parse(data);
                if (data.returnCode == 1) {
                    $('#myModal').modal("hide");
                    $.showMessage({parentId: "showMessage", message: "信息保存成功！", type: "success"});
                    refreshTable();
                } else {
                    $.showMessage({parentId: "errorMessage", message: "<strong>错误信息</strong>：" + data.returnMsg, type: "error"});
                }
            }
        });
    }


    function deleteEditjjbmx(id) {
        if (id != undefined) {
            $.confirm({
                confirm: function () {
                    $("#confirmModal").modal("hide");
                    $.post("${absoluteContextPath}/xc/xcJjbhz/deletes", {
                        'id': id
                    }, function (data) {
                        data = JSON.parse(data);
                        if (data.returnCode == 1) {
                            $.showMessage({parentId: "errorMessage", message: "问题答案数据删除成功！", type: "success"});
                            $("#" + id + "").remove();
                        } else {
                            $.showMessage({parentId: "errorMessage", message: "问题答案数据删除异常！", type: "error"});
                        }
                    });
                }
            });
        }
    }
</script>